import newaxios from '@/service/request';
import {defineStore} from 'pinia';
const useOrdeerStore = defineStore("order",{
    state:()=>({
        allOrder:[],
        pend:[]
    }),
    actions:{
        async getAllOrder(){
            const {data:{data:{orders}}} = await newaxios.get("order/list",{params:{type:"all" }})
            this.allOrder = orders
            console.log(this.allOrder);
        },
        async getPend(){
            const {data:{data:{orders}}} = await newaxios.get("order/list",{params:{type:"pend" }})
            this.pend = orders
        }
    }
})
export default useOrdeerStore